<?php
// +----------------------------------------------------------------------
// | saiadmin [ saiadmin快速开发框架 ]
// +----------------------------------------------------------------------
// | Author: your name
// +----------------------------------------------------------------------
namespace plugin\saiadmin\app\validate\test;

use think\Validate;

/**
 * 测试表验证器
 */
class TestValidate extends Validate
{
    /**
     * 定义验证规则
     */
    protected $rule =   [
        'user_id' => 'require',
        'username' => 'require',
        'sex' => 'require',
        'mobile' => 'require',
        'money' => 'require',
    ];

    /**
     * 定义错误信息
     */
    protected $message  =   [
        'user_id' => '用户ID必须填写',
        'username' => '用户名必须填写',
        'sex' => '性别:0=保密,1=男,2=女必须填写',
        'mobile' => '手机号必须填写',
        'money' => '余额必须填写',
    ];

    /**
     * 定义场景
     */
    protected $scene = [
        'save' => [
            'user_id',
            'username',
            'sex',
            'mobile',
            'money',
        ],
        'update' => [
            'user_id',
            'username',
            'sex',
            'mobile',
            'money',
        ],
    ];

}
